//
//  CommonService.h
//  DYS
//
//  Created by 房 国生 on 15/6/19.
//  Copyright (c) 2015年 lyss. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MBProgressHUD.h"
#import "ParkEntity.h"
#import "UserEntity.h"

@protocol CommonServerDelegate <NSObject>

- (CGFloat) getDownloadProgress:(CGFloat)progress;
- (void) finishDownload:(BOOL) success;

@end

@interface CommonService : NSObject

@property (nonatomic, weak) id<CommonServerDelegate> delegate;

- (void)getNetWorkData:(NSDictionary *)param
                  Path:(NSString *)path
             Successed:(void(^)(id entity)) successed
                Failed:(void(^)(NSInteger errorCode ,NSString *message))failed;

- (void)getDianPingData:(NSDictionary *)param
                  Path:(NSString *)path
             Successed:(void(^)(id entity)) successed
                Failed:(void(^)(NSInteger errorCode ,NSString *message))failed;

- (void)getHomeAdImage:(NSDictionary *)param
             Successed:(void(^)(NSArray *entity)) successed
                Failed:(void(^)(NSInteger errorCode ,NSString *message))failed;

+ (NSDictionary *) uploadUserImage:(UserEntity *)user
                          FileName:(NSString *)fileName
                             Image:(NSData *)imageData;

+ (NSDictionary *)uploadUserYJ:(NSDictionary *)dicYJ
                      FileName:(NSMutableArray *)fileName
                         Image:(NSMutableArray *)imageData;

- (void)downloadFileURL:(NSString *)aUrl
               SavePath:(NSString *)aSavePath
               FileName:(NSString *)aFileName
                    Tag:(NSInteger)aTag;

- (BOOL) getSpotDataFromLocal:(NSString *)parkId
                       CityId:(NSString *)cityId
                    ArraySpot:(NSMutableArray *)arraySpot
                ArrayBusiness:(NSMutableArray *)arrayBusiness
                  ArrayToilet:(NSMutableArray *)arrayToilet
                ArrayRoadLine:(NSMutableArray *)arrayRoadLine
                   ParkEntity:(ParkEntity *)parkEntity
        ArrayBusinessTogether:(NSMutableArray *)arrayBusinessTogether
                        Array:(NSMutableArray *)arrayTogether
                 TopBannerArr:(NSMutableArray *)topBannerArr
                  ActivityArr:(NSMutableArray *)activityArr;

- (BOOL) getSpotLocalData:(NSString *)parkId
                ArraySpot:(NSMutableArray *)arraySpot;
+ (NSString *) addLocalRootPath:(NSString *)url
                         ParkId:(NSString *)parkId;

+ (NSString *) getLocalRootPath:(NSString *)parkId;

+ (NSString *)getFolderSize:(NSString *)parkId;
//单个文件的大小
+ (long long) fileSizeAtPath:(NSString*) filePath;
+ (BOOL) deleteFile:(NSString *)filePath;

+ (void)initShareSDK;

+ (void)showShareActionSheet:(UIView *)view
                         HUD:(MBProgressHUD *)hud
                  ImageArray:(NSArray* )imageArray
                         URL:(NSString *)url
                       Title:(NSString *)title
                     Content:(NSString *)content;

+ (BOOL)isExistenceLETFINetwork:(NSString *)url;



@end
